import React from "react";
import { Toast, NavBar, Button, Input, Form } from "react-vant";
import { useNavigate } from "react-router-dom";

const Index: React.FC = () => {
  const navigate = useNavigate();
  const [form] = Form.useForm();

  const onFinish = (values:any) => {
    console.log(values);
  };
  return (
    <div>
      <NavBar title="修改密码" onClickLeft={() => navigate(-1)} />
      <Form
        form={form}
        onFinish={onFinish}
        footer={
          <div style={{ margin: "16px 16px 0" }}>
            <Button round nativeType="submit" type="primary" block>
              提交
            </Button>
          </div>
        }
      >
        <Form.Item
          tooltip={{
            message:
              "A prime is a natural number greater than 1 that has no positive divisors other than 1 and itself.",
          }}
      
          rules={[{ required: true, message: "请输入原密码" }]}
          name="username"
          label="原密码"
        >
          <Input placeholder="请输入原密码" />
        </Form.Item>
        <Form.Item
          rules={[{ required: true, message: "请填写密码" }]}
          name="password"
          label="新密码"
        >
          <Input placeholder="请输入密码" />
        </Form.Item>
      </Form>
    </div>
  );
};
export default Index;
